package vip;

public class VipManager {
	String mname;
	String gonghao;
	Vip[] customs = new Vip[100];

	// 增加一个新客户
	public void add(Vip v) {
		for (int i = 0; i < customs.length; i++) {
			if (customs[i] == null) {
				customs[i] = v;
				return;
			}
		}
	}

	public void add2(String c, int jifen) {
		for (int i = 0; i < customs.length; i++) {
			if (customs[i] == null) {
				customs[i] = new Vip();
				customs[i].cardNo = c;
				customs[i].score = jifen;
				return;
			}
		}
	}

	// 打印现有客户信息
	public void printCust() {
		for (int i = 0; i < customs.length; i++) {
			if (customs[i] != null)
				customs[i].show();
		}
	}

	// 根据卡号查找积分
	// 返回数字，不好体现帐号不在这种情况
	public Vip search(String card) {
		for (int i = 0; i < customs.length; i++) {
			if (customs[i] != null && customs[i].cardNo.equals(card)) {
				return customs[i];
			}
		}
		return null;// 神补刀
	}
}
